package com.ruoyi.camp.service.impl;

import java.util.List;

import com.ruoyi.common.utils.uuid.IdUtils;
import com.ruoyi.common.utils.uuid.UUID;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.camp.mapper.CBannerMapper;
import com.ruoyi.camp.domain.CBanner;
import com.ruoyi.camp.service.ICBannerService;

/**
 * bannerService业务层处理
 * 
 * @author ruoyi
 * @date 2024-10-08
 */
@Service
public class CBannerServiceImpl implements ICBannerService 
{
    @Autowired
    private CBannerMapper cBannerMapper;

    /**
     * 查询banner
     * 
     * @param bannerId banner主键
     * @return banner
     */
    @Override
    public CBanner selectCBannerByBannerId(String bannerId)
    {
        return cBannerMapper.selectCBannerByBannerId(bannerId);
    }

    /**
     * 查询banner列表
     * 
     * @param cBanner banner
     * @return banner
     */
    @Override
    public List<CBanner> selectCBannerList(CBanner cBanner)
    {
        return cBannerMapper.selectCBannerList(cBanner);
    }

    /**
     * 新增banner
     * 
     * @param cBanner banner
     * @return 结果
     */
    @Override
    public int insertCBanner(CBanner cBanner)
    {
        //增加随机UUID
        cBanner.setBannerId(IdUtils.randomUUID());
        return cBannerMapper.insertCBanner(cBanner);
    }

    /**
     * 修改banner
     * 
     * @param cBanner banner
     * @return 结果
     */
    @Override
    public int updateCBanner(CBanner cBanner)
    {
        return cBannerMapper.updateCBanner(cBanner);
    }

    /**
     * 批量删除banner
     * 
     * @param bannerIds 需要删除的banner主键
     * @return 结果
     */
    @Override
    public int deleteCBannerByBannerIds(String[] bannerIds)
    {
        return cBannerMapper.deleteCBannerByBannerIds(bannerIds);
    }

    /**
     * 删除banner信息
     * 
     * @param bannerId banner主键
     * @return 结果
     */
    @Override
    public int deleteCBannerByBannerId(String bannerId)
    {
        return cBannerMapper.deleteCBannerByBannerId(bannerId);
    }
}
